using UnityEngine;
using System.Collections;
using AnimationOrTween;

public class ButtoncontrolMoveQueue : MonoBehaviour {
	public GameObject[] FirstGroup;
	public GameObject[] SecondGroup;
	
	bool option = true;
	
	void OnClick(){
		if(option){
			for(int i = 0;i < FirstGroup.Length;i++){
				UITweener tw = FirstGroup[i].GetComponent<UITweener>();
				tw.Play(option);
			}
		} else {
			for(int i = 0;i < SecondGroup.Length;i++){
				UITweener tw = SecondGroup[i].GetComponent<UITweener>();
				tw.Play(option);
			}
		}
		option  = !option;
	}
	
	void PlayNext(){
		if(option){
			for(int i = 0;i < FirstGroup.Length;i++){
				UITweener tw = FirstGroup[i].GetComponent<UITweener>();
				tw.Play(!option);
			}
		} else {
			for(int i = 0;i < SecondGroup.Length;i++){
				UITweener tw = SecondGroup[i].GetComponent<UITweener>();
				tw.Play(!option);
			}
		}
	}
}